<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.etc.controller.*" %>
<%@page import="com.etc.entity.*" %>
<%@page import="com.etc.dao.*" %>
<%@page import="java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>羔羊论坛</title>
<link rel="icon" type="image/x-icon" href="img/sheep.ico" />
<link rel="stylesheet" type="text/css" href="css/seniorshow.css" />
</head>
<body>
<%
	request.setCharacterEncoding("UTF-8");
	List<Message> list = (List<Message>)request.getSession().getAttribute("seniorlist");
	String search = (String)request.getSession().getAttribute("search");
	String username = (String)request.getSession().getAttribute("username");
	if(list.size()>0)
	{
		int xuhao=0;
		out.print("<ul>");
		for(int i=0;i<list.size();i++)
		{
			xuhao+=1;
			if("正常"==list.get(i).getStatus()||"正常".equals(list.get(i).getStatus()))
			{
			%>
			 	<li><a href="AnsMessageServlet?am=detail&title=<%=list.get(i).getTitle()%>&id=<%=list.get(i).getId()%>">
				 			<p><font class="title"><%=xuhao %>&nbsp;&nbsp;<%=list.get(i).getTitle()%></font>&nbsp;&nbsp;&nbsp;<font class="name"><%=list.get(i).getUsername()%></font>&nbsp;&nbsp;&nbsp;<font class="date"><%=list.get(i).getDate()%></font></p>
				 		
				 			<p><%=list.get(i).getContent()%></p>
			 	</a></li>
			<%
			}
			else
			{
			%>
			 	<li><a href="AnsMessageServlet?am=detail&title=<%=list.get(i).getTitle()%>&id=<%=list.get(i).getId()%>">
				 			<p><font class="title" style="color:red"><%=xuhao %>&nbsp;&nbsp;<%=list.get(i).getTitle()%></font>&nbsp;&nbsp;&nbsp;<font class="name" style="color:red"><%=list.get(i).getUsername()%></font>&nbsp;&nbsp;&nbsp;<font class="date" style="color:red"><%=list.get(i).getDate()%></font></p>		
				 			<p style="color:red">用户发言涉嫌违规内容，已屏蔽该内容</p>
			 	</a></li>
			<%
			}
		}
		out.print("</ul>");
	}
	else
	{
		if(username==null||"".equals(username))
			out.print("<p class='tip'>当前没有该分类的帖子</p>");
		else
			out.print("<p class='tip'>当前没有该分类的帖子&nbsp<a href='user_info.jsp' target='_parent'>去发一条</a></p>");
	}
	%>
</body>
</html>